package com.badou.project.moduleDemo.web.fun2;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;
import org.springframework.beans.factory.annotation.Autowired;

import com.badou.core.base.support.struts.BaseStrutsAction;
import com.badou.project.moduleDemo.model.Fun2DemoEntity;
import com.badou.project.moduleDemo.service.IFun2DemoService;
import com.badou.project.moduleDemo.web.form.Fun2DemoForm;
import com.badou.tools.vendors.struts2.annotation.result.DispatcherResult;
import com.badou.viewer.ligerui.struts2.JsonListTemplateAction;
 
public class Fun2DemoAction extends JsonListTemplateAction<Fun2DemoEntity, Serializable, Fun2DemoForm> {
	/**	
	 * 
	 */
	private static final long serialVersionUID = 3366266563009769734L;
	
	@Autowired
	private IFun2DemoService Fun2DemoService;
	@Autowired
	public void setFun2DemoService(IFun2DemoService Fun2DemoService) {
		this.Fun2DemoService = Fun2DemoService;
		super.setBaseService(Fun2DemoService);
	}
	
	List<Fun2DemoEntity> list = null;
	  
	 @Action
     public HttpHeaders index(){  
		 list =  Fun2DemoService.listAll();
    	 return  new DefaultHttpHeaders("index").disableCaching(); 
     }  
}
